*Set working drive to Main filepath (e.g. C:\Documents\) 
cd "INSERT DESIRED FILE PATH"

*Load data 
use LandgraveWeller_2020_NamePerception.dta, clear 

*Set working drive to Tables and Figures Subfolder
cd "INSERT DESIRED FILE PATH\Tables and Figures"

			*||| MAIN ANALYSIS |||*

*Table 1 – Perceived Name Characteristics by Purported Race and Ethnicity
reg White NameBlack NameHispanic if IntendedRace != 3, cluster(ID)
outreg2 using "Table1.xls", replace dec(3) ///
addnote("Errors clustered by Mturk subject.")

reg WorkingClass NameBlack NameHispanic if IntendedRace != 3, cluster(ID)
outreg2 using "Table1.xls", append label dec(3)

reg Migrant NameBlack NameHispanic if IntendedRace != 3, cluster(ID)
outreg2 using "Table1.xls", append label dec(3)


			*||| ONLINE APPENDICES  |||*
			  *||| Tables 6 - 8  |||*
			
*Appendix A Table 6 – Name Perceptions of Hispanic Surnames Paired with English vs Spanish First names
reg White Jose Martinez, cluster(ID)
outreg2 using "AppendixATable6.xls", replace label dec(3) ///
addnote("Errors clustered by Mturk subject.")

reg WorkingClass Jose Martinez, cluster(ID)
outreg2 using "AppendixATable6.xls", append label dec(3)

reg Migrant Jose Martinez, cluster(ID)
outreg2 using "AppendixATable6.xls", append label dec(3)

reg Noncitizen Jose Martinez, cluster(ID)
outreg2 using "AppendixATable6.xls", append label dec(3)

*Appendix A Table 8 – Name Perceptions by MTurk Respondents’ Demographics
reg White RWhite RRepublican RAge RFemale ///
if IntendedRace != 3, cluster(ID)
outreg2 using "AppendixATable8.xls", ///
replace label dec(3) ///
addnote("Errors clustered by Mturk subject.")

reg WorkingClass RWhite RRepublican RAge RFemale if IntendedRace != 3, cluster(ID)
outreg2 using "AppendixATable8.xls", ///
append label dec(3)

reg Migrant RWhite RRepublican RAge RFemale if IntendedRace != 3, cluster(ID)
outreg2 using "AppendixATable8.xls", ///
append label dec(3)

reg Gender RWhite RRepublican RAge RFemale if IntendedRace != 3, cluster(ID)
outreg2 using "AppendixATable8.xls", ///
append label dec(3)

*Appendix A Table 7b – State Legislators and MTurk Respondents' Demographics, MTurk Respondents
	*Note: See LandgraveWeller_2020_ Analysis _ Audit.do for Appendix A Table 7a 

collapse RWhite RRepublican RFemale,by(ID)
asdoc sum RWhite RRepublican RFemale, replace save(TableA7b.doc)


			  *||| Tables 1 - 4  |||*
			  
*Set working drive to Main filepath (e.g. C:\Documents\) 
cd "INSERT DESIRED FILE PATH"

*Load data 
use LandgraveWeller_2020_NamePerception_Supplemental.dta, clear

*Set working drive to Tables and Figures Subfolder
cd "INSERT DESIRED FILE PATH\Tables and Figures"

			  
*Appendix A Table 1 - Perceived Race and Ethnicity by Name

asdoc tab P_Race_NicholasSmith, replace save(TableA1.doc)

foreach var of varlist P_Race_EthanMiller P_Race_JohnRyan P_Race_DanielSchmitz P_Race_TyrekeBrown P_Race_JamalGaines P_Race_DeMarWashington P_Race_KobeJefferson P_Race_JoeGarcia P_Race_JoeMartinez P_Race_MichaelGonzalez P_Race_JohnChavez {
asdoc tab `var', append save(TableA1.doc)
}

*Appendix A Table 2 - Perceived Gender by Name

asdoc tab P_Gender_NicholasSmith, replace save(TableA2.doc)

foreach var of varlist P_Gender_EthanMiller P_Gender_JohnRyan P_Gender_DanielSchmitz P_Gender_TyrekeBrown P_Gender_JamalGaines P_Gender_DeMarWashington P_Gender_KobeJefferson P_Gender_JoeGarcia P_Gender_JoeMartinez P_Gender_MichaelGonzalez P_Gender_JohnChavez {
asdoc tab `var', append save(TableA2.doc)
}

*Appendix A Table 3 - Perceived Nativity by Name

asdoc tab P_Nativity_NicholasSmith, replace save(TableA3.doc)

foreach var of varlist P_Nativity_EthanMiller P_Nativity_JohnRyan P_Nativity_DanielSchmitz P_Nativity_TyrekeBrown P_Nativity_JamalGaines P_Nativity_DeMarWashington P_Nativity_KobeJefferson P_Nativity_JoeGarcia P_Nativity_JoeMartinez P_Nativity_MichaelGonzalez P_Nativity_JohnChavez {
asdoc tab `var', append save(TableA3.doc)
}

*Appendix A Table 4 - Perceived SES by Name

asdoc tab P_SES_NicholasSmith, replace save(TableA4.doc)

foreach var of varlist P_SES_EthanMiller P_SES_JohnRyan P_SES_DanielSchmitz P_SES_TyrekeBrown P_SES_JamalGaines P_SES_DeMarWashington P_SES_KobeJefferson P_SES_JoeGarcia P_SES_JoeMartinez P_SES_MichaelGonzalez P_SES_JohnChavez {
asdoc tab `var', append save(TableA4.doc)
}

